/*
 Navicat Premium Data Transfer

 Source Server         : local
 Source Server Type    : MySQL
 Source Server Version : 80026
 Source Host           : localhost:3306
 Source Schema         : testDB

 Target Server Type    : MySQL
 Target Server Version : 80026
 File Encoding         : 65001

 Date: 04/10/2021 20:07:12
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for student
-- ----------------------------
DROP TABLE IF EXISTS `student`;
CREATE TABLE `student` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `age` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of student
-- ----------------------------
BEGIN;
INSERT INTO `student` VALUES (2, '贾奥', 21);
INSERT INTO `student` VALUES (3, '于洋', 20);
INSERT INTO `student` VALUES (4, '杨文旭', 20);
INSERT INTO `student` VALUES (5, '沈致远', 19);
INSERT INTO `student` VALUES (6, '朱佳喜', 21);
INSERT INTO `student` VALUES (19, '周长昊', 21);
INSERT INTO `student` VALUES (20, '黄海林', 22);
COMMIT;

-- ----------------------------
-- Procedure structure for getUserAndAgeById
-- ----------------------------
DROP PROCEDURE IF EXISTS `getUserAndAgeById`;
delimiter ;;
CREATE PROCEDURE `getUserAndAgeById`(IN id_in INT,OUT name_out CHAR(255),OUT age_out INT)
BEGIN
	SELECT name INTO name_out
	FROM student
	WHERE student.id=id_in;
	
	SELECT age INTO age_out
	FROM student
	WHERE student.id=id_in;
END
;;
delimiter ;

SET FOREIGN_KEY_CHECKS = 1;
